

from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import ListAPIView
from meiduo_admin.serializers.perm_serializers import *
from meiduo_admin.custom_page import MyPage


class ContentTypeListView(ListAPIView):
    queryset = ContentType.objects.all()
    serializer_class = ContentTypeSerializer



class PermModelViewSet(ModelViewSet):

    queryset = Permission.objects.all()
    serializer_class = PermModelSerializer
    pagination_class = MyPage

    def get_queryset(self):
        return self.queryset.order_by('pk').all()

